﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using Microsoft.Office.Tools.Ribbon;

namespace NanUIforVSTODemo.WordPlugin
{
    public partial class NanUIDemoRibbon
    {

        private void NanUIDemoRibbon_Load(object sender, RibbonUIEventArgs e)
        {

        }

        private void btnLaunchFormium_Click(object sender, RibbonControlEventArgs e)
        {
            var demoWindow = new DemoWindow();
            demoWindow.Show(new WordWindowHWND(Globals.ThisAddIn.Application.ActiveWindow.Hwnd));
        }
    }

    public class WordWindowHWND : IWin32Window
    {
        public IntPtr Handle { get; }

        public WordWindowHWND(int hwnd)
        {
            Handle = (IntPtr)hwnd;
        }
    }
}
